package oopday02;
//
public class Teacher extends Person {
    //1.声明子类特有的成员变量
    double salary;
    //3.声明构造方法
    //3.1无参构造
    Teacher(){
    }
    //3,2全参构造
    Teacher(String name, int age,String address, double salary) {
        super(name, age, address);
        this.salary = salary;
    }

    //2.声明子类特有的方法
    void teach(){
        System.out.println(name+"正在上课");
    }
    void sayHi(){
        System.out.println("大家好，我叫：" + name + ",今年" + age + "岁了，家住" + address
                + ",工资为：" + salary);
    }
}